package com.btkjgc.models;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by _ESE on 2015/1/29.
 */
public class LeftMenu implements java.io.Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 6718324513911401279L;
	private Integer id; // id
	private Integer parentid;
	private boolean needend;
	private boolean need2end;
	private Integer level;
	private String icon;
	private String text;
	private boolean active;
	private Integer index;
	private Boolean roleApproved;
	private Integer visiable;

	List<LeftMenu> submenus = new ArrayList<LeftMenu>();

	public boolean valid()
	{
		if (getUrl() == null || (getUrl() != null && !getUrl().startsWith("/")))
		{
			if (getSubmenus().size() == 0) { return false; }
		}
		return true;
	}

	public boolean hasSubMenu()
	{
		return this.getSubmenus().size() == 0;
	}

	public Integer getIndex()
	{
		return index;
	}

	public void setIndex(Integer index)
	{
		this.index = index;
	}

	public boolean isActive()
	{
		return active;
	}

	public void setActive(boolean active)
	{
		this.active = active;
	}

	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public Integer getLevel()
	{
		return level;
	}

	public void setLevel(Integer level)
	{
		this.level = level;
	}

	public String getText()
	{
		return text;
	}

	public void setText(String text)
	{
		this.text = text;
	}

	private String url;

	private String nav_url;

	public Integer getParentid()
	{
		return parentid;
	}

	public void setParentid(Integer parentid)
	{
		this.parentid = parentid;
	}

	public String getUrl()
	{
		return url;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

	public String getIcon()
	{
		return icon;
	}

	public void setIcon(String icon)
	{
		this.icon = icon;
	}

	public boolean isNeedend()
	{
		return needend;
	}

	public void setNeedend(boolean needend)
	{
		this.needend = needend;
	}

	public boolean isNeed2end()
	{
		return need2end;
	}

	public void setNeed2end(boolean need2end)
	{
		this.need2end = need2end;
	}

	public List<LeftMenu> getSubmenus()
	{
		return submenus;
	}

	public void setSubmenus(List<LeftMenu> submenus)
	{
		this.submenus = submenus;
	}

	public Boolean getRoleApproved()
	{
		return roleApproved;
	}

	public void setRoleApproved(Boolean roleApproved)
	{
		this.roleApproved = roleApproved;
	}

	public String getNav_url()
	{
		return nav_url;
	}

	public void setNav_url(String nav_url)
	{
		this.nav_url = nav_url;
	}

	public Integer getVisiable()
	{
		return visiable;
	}

	public void setVisiable(Integer visiable)
	{
		this.visiable = visiable;
	}

}
